
<script language="javascript">

	function openMessage(e,id,type) {ldelim}
		var forma = document.getElementById('message_form');
		forma.id.value=id;
		forma.message.value="";
		forma.type.value=type;
		document.getElementById('message_div_content').innerHTML="";
		openDiv(e,'message_div_form');
		openDiv(e,'messagediv');
		if (type=="adm") {ldelim}
			document.getElementById('mailfield').style.display="";
			forma.replyto.value="";
			forma.replyto.focus();
		{rdelim} else {ldelim}
			document.getElementById('mailfield').style.display="none";
			forma.message.focus();
		{rdelim}
	{rdelim}
	
	function sendMessage() {ldelim}
		closeForm('message_div_form');
		xajax.$('message_div_content').innerHTML="{$lang.sending}";
		showprogress();
		xajax_sendMessage(xajax.getFormValues("message_form"));
	{rdelim}
	
</script>

<div name="messagediv" id="messagediv" style="display: none;" class="floatingform">
{include file="close.tpl" element="messagediv"}
<div id="message_div_content"></div>
<div id="message_div_form">
<form method="post" id="message_form">
	<input type="hidden" name="id" id="id" value="">
	<input type="hidden" name="fid" id="fid" value="{$CURRENT_USER->userid}">
	<input type="hidden" name="type" id="type" value="">
	<table border="0" cellpadding="0" cellspacing="0">
		<tr id="mailfield" style="display: none;">
			<td>{$lang.mail}</td>
			<td>
				<input type="text" class="txt" name="replyto" id="replyto" size="20"/>
			</td>
		</tr>
		<tr>
			<td>{$lang.message}</td>
			<td>
				<textarea class="txt" name="message" id="message" rows="5" cols="20" wrap="virtual"></textarea>
			</td>
		</tr>
	   	<tr>
   		<td>&nbsp;</td>
	 		<td align="right">
	 			{include file="button.tpl" name=$lang.sendmp action="sendMessage()"}	
	 		</td>
			   	
   		</tr>	
   </table>	
</form>
</div>
</div>